﻿<Window x:Class="BioWF.Views.WorkflowArgumentWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:viewModels="clr-namespace:BioWF.ViewModels"
        xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
        xmlns:interactivity="http://www.julmar.com/wpfhelpers"
        Background="WhiteSmoke" WindowStartupLocation="CenterOwner"
        Height="500" Width="500" Title="{Binding ActivityName, StringFormat='Enter arguments for {0}'}">

    <Window.Resources>
        <DataTemplate DataType="{x:Type viewModels:TextArgumentViewModel}">
            <StackPanel>
                <TextBlock Text="{Binding Title}" Margin="5" FontWeight="Bold" />
                <TextBox Text="{Binding Value, Mode=TwoWay}" Margin="5" />
            </StackPanel>
        </DataTemplate>
        <DataTemplate DataType="{x:Type viewModels:IntArgumentViewModel}">
            <StackPanel>
                <TextBlock Text="{Binding Title}" Margin="5" FontWeight="Bold" />
                <TextBox Text="{Binding Value, Mode=TwoWay}" Margin="5">
                    <i:Interaction.Behaviors>
                        <interactivity:NumericTextBoxBehavior />
                    </i:Interaction.Behaviors>
                </TextBox>
            </StackPanel>
        </DataTemplate>
        <DataTemplate DataType="{x:Type viewModels:BooleanArgumentViewModel}">
            <CheckBox IsChecked="{Binding Value, Mode=TwoWay}" Margin="5" FontWeight="Bold" Content="{Binding Title}" />
        </DataTemplate>
        <DataTemplate DataType="{x:Type viewModels:DateTimeArgumentViewModel}">
            <StackPanel>
                <TextBlock Text="{Binding Title}" Margin="5" FontWeight="Bold" />
                <DatePicker SelectedDate="{Binding Value, Mode=TwoWay}" Margin="5" />
            </StackPanel>
        </DataTemplate>
    </Window.Resources>
    
    <DockPanel>
        <StackPanel DockPanel.Dock="Bottom" HorizontalAlignment="Right" Orientation="Horizontal" Margin="10">
            <Button Content="OK" Padding="10,5" Margin="5" MinWidth="75" IsDefault="True">
                <i:Interaction.Behaviors>
                    <interactivity:CloseDialogBehavior DialogResult="True" />
                </i:Interaction.Behaviors>
            </Button>
            <Button Content="Cancel" Padding="10,5" Margin="5" MinWidth="75" IsCancel="True" />
        </StackPanel>
        
        <ItemsControl ItemsSource="{Binding Arguments}" Margin="5" />
    </DockPanel>
    
    
</Window>
